package com.gs.api.projects.bzapplets.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.gs.api.projects.bzapplets.dao.BzAllWallpaperDao;
import com.gs.api.projects.bzapplets.entity.BzAllWallpaper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author guoyunfei on 2021/9/25 15:30
 * @className DouyinWallpaperService
 * @description TODO
 * @Version 1.0
 */

@Service
public class BzAllWallpaperService extends ServiceImpl<BzAllWallpaperDao, BzAllWallpaper> {


    @Autowired
    private BzAllWallpaperDao bzAllWallpaperDao;

    public PageInfo<BzAllWallpaper> selectAllWallpaper(BzAllWallpaper wallpaper, int pageNum, int pageSize, String order){
        PageHelper.startPage(pageNum, pageSize).setOrderBy(order);
        wallpaper.setIsDelete(1);
        final PageInfo<BzAllWallpaper> userPageInfo = new PageInfo<>(bzAllWallpaperDao.selectAllWallpaper(wallpaper));
        return userPageInfo;
    }

    public BzAllWallpaper getById(Integer id){
        return bzAllWallpaperDao.getById(id);
    }

}
